package cmd

import (
	"fmt"
	"ginx/server"
	"github.com/spf13/cobra"
	"os"
)

var rootCmd = &cobra.Command{
	Use: "ginx",
	Short: "ginx is a proxy-server based on go",
	Long: `ginx is a very interesting proxy-server based on go`,
	Run: func(cmd *cobra.Command, args []string) {
		if len(args) == 0 {
			var master server.Master
			master.Start()
		}
	},
}

func Execute() {
	if err := rootCmd.Execute(); err != nil {
		fmt.Println(err)
		os.Exit(1)
	}
}